
local mt = ac.skill['升级蟹笼']
mt.lv = 0
mt.art = [[ReplaceableTextures\CommandButtons\BTNSkillz.blp]]
mt.tip = [[
当前等级：'lv'

花费|cffffff00'jb1'|r金币，之后每天额外获得|cff00ff00'jb2'|r金币的工资
每升级5次额外获得|cff00ff005%|r工资加成
]]


function mt:jb1()
    return 500 * (math.floor(self.lv/5) + 1)
end

function mt:jb2()
    return self:jb1()*0.3
end

function mt:on_cast_shot()
    local unit = self.owner
    local player = unit.owner
	local skill = self.parent_skill or self
    local jb1 = self:jb1()
    local jb2 = self:jb2()
    if self.lv==100 then
        player:send_msg('|cffff0000已经满级|r')
        return
    end
    if player:get('金币')<jb1 then
        show_skill_tip(player,self.slotid,'金币')
        return
    end
    show_skill_tip(player,self.slotid,'成功')
    player:add('金币',-jb1)
    player:send_msg(('|cffffff00每日工资|r|cff00ff00+%0.f|r'):format(jb2))
    player:add('额外工资',jb2)

    skill.lv = skill.lv + 1
    if skill.lv%5==0 then
        player:add('工资加成',5)
    end
    unit:notify("单位-刷新技能显示", unit)

end


